* doc-view.el (doc-view-odf->pdf-converter-soffice): Use separate
authorTassilo Horn <tsdh@gnu.org>
Tue, 12 Feb 2013 10:52:47 +0000 (11:52 +0100)
committerTassilo Horn <tsdh@gnu.org>
Tue, 12 Feb 2013 10:52:47 +0000 (11:52 +0100)
UserInstallation when calling soffice to work around LibreOffice
bug 37531.

lisp/ChangeLog
lisp/doc-view.el

index e0f15251305ae12a8abc1e905aa6e0ec308dcbfa..be399aa8d27ae1273e233264ba369175e01fc2d1 100644 (file)
@@ -1,3 +1,9 @@
+2013-02-12  Tassilo Horn  <tsdh@gnu.org>
+
+       * doc-view.el (doc-view-odf->pdf-converter-soffice): Use separate
+       UserInstallation when calling soffice to work around LibreOffice
+       bug 37531.
+
 2013-02-12  Glenn Morris  <rgm@gnu.org>
 
        * files.el (basic-save-buffer):
index edd59a7b5184a065c7ef72b7aa35b5c556efacbc..da0b728ce91720f134424a84b1f0cba4c9ed8b55 100644 (file)
@@ -940,8 +940,20 @@ is named like ODF with the extension turned to pdf."
 The converted PDF is put into the current cache directory, and it
 is named like ODF with the extension turned to pdf."
   (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program
-                         (list "--headless" "--convert-to" "pdf"
-                               "--outdir" (doc-view-current-cache-dir) odf)
+                         (list
+                          ;; FIXME: soffice doesn't work when there's
+                          ;; another running LibreOffice instance, in
+                          ;; which case it returns success without
+                          ;; actually doing anything.  See
+                          ;; LibreOffice bug
+                          ;; https://bugs.freedesktop.org/show_bug.cgi?id=37531.
+                          ;; A workaround is to start soffice with a
+                          ;; separate UserInstallation directory.
+                          (concat "-env:UserInstallation=file://"
+                                  (expand-file-name (format "libreoffice-docview%d" (user-uid))
+                                                    temporary-file-directory))
+                          "--headless" "--convert-to" "pdf"
+                          "--outdir" (doc-view-current-cache-dir) odf)
                          callback))
 
 (defun doc-view-pdf/ps->png (pdf-ps png)